<!DOCTYPE html>

<html>

	<head>
<meta charset="utf-8">
	
		<title>Custom Events</title>
	
		<link rel="stylesheet" type="text/css" href="../src/DateTimePicker.css" />
		
		<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
		<script type="text/javascript" src="../src/DateTimePicker.js"></script>
	
		<!--[if lt IE 9]>
			<link rel="stylesheet" type="text/css" href="../src/DateTimePicker-ltie9.css" />
			<script type="text/javascript" src="../src/DateTimePicker-ltie9.js"></script>
		<![endif]-->
	
		<style>
		
			p
			{
				margin-left: 20px;
			}
		
			input
			{
				width: 200px;
				padding: 10px;
				margin-left: 20px;
				margin-bottom: 20px;
			}
		
			.pickerButton
			{
				background: #FFFFFF;
				color: #A3A3CC;
				border: 2px solid #A3A3CC;
				border-radius: 5px;
				padding: 10px 20px;
				margin: 20px;
			
				cursor: pointer;
			}
		
			.pickerButton:hover
			{
				color: #CCA3A3;
				border-color: #CCA3A3;
			}
		
		</style>
	
	</head>
	
	<body>
	
		<div class="container">
		
			<div id="datePicker">
				<p>Date : </p>
				<input type="text" data-field="date" readonly>
				<span class="pickerButton">Show</span>
			</div>
		
			<div id="timePicker">
				<p>Time : </p>
				<input type="text" data-field="time" readonly>
				<span class="pickerButton">Show</span>
			</div>
		
			<div id="dateTimePicker">
				<p>DateTime : </p>
				<input type="text" data-field="datetime" readonly>
				<span class="pickerButton">Show</span>
			</div>
		
		</div>
		
		<div id="dtBox"></div>
		
		<script type="text/javascript">
		
			$(document).ready(function()
			{
				$("#dtBox").DateTimePicker(
				{
					addEventHandlers: function()
					{
						var dtPickerObj = this;
					
						$("input").attr("disabled", "disabled");
					
						$("#datePicker .pickerButton").click(function(e)
						{
							e.stopPropagation();
							dtPickerObj.showDateTimePicker($("#datePicker input"));
						});
					
						$("#timePicker .pickerButton").click(function(e)
						{
							e.stopPropagation();
							dtPickerObj.showDateTimePicker($("#timePicker input"));
						});
					
						$("#dateTimePicker .pickerButton").click(function(e)
						{
							e.stopPropagation();
							dtPickerObj.showDateTimePicker($("#dateTimePicker input"));
						});
					}
				});
			});
		
		</script>
	
	</body>

</html>
